//package com.canal.mq.consumer;
//
//import com.alibaba.fastjson.JSONArray;
//import com.alibaba.fastjson.JSONObject;
//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
//import org.apache.rocketmq.spring.core.RocketMQListener;
//import org.springframework.stereotype.Service;
//
//@Service
//@RocketMQMessageListener(topic = "test", consumerGroup = "consumer_group_1",accessKey = "",secretKey = "" )
//public class RocketCanalListener implements RocketMQListener<JSONObject> {
//
//    public void onMessage(JSONObject jsonObject) {
//        String sqlType = jsonObject.getString("type");
//        JSONArray data = jsonObject.getJSONArray("data");
//        System.out.println("表名为:" + jsonObject.getString("table") + ",sql类型为：" + sqlType);
//        if ("UPDATE".equals(sqlType) || "INSERT".equals(sqlType)) {
//            System.out.println(data);
//            return;
//        }
//        if ("DELETE".equals(sqlType)) {
//            System.out.println(data);
//        }
//    }
//}
